import request from '../utils/request'

/**
 * 关注用户
 * @param {Number} followUserId - 被关注用户ID
 * @returns {Promise}
 */
export function followUser(followUserId) {
  return request({
    url: `/follows/user/${followUserId}`,
    method: 'post'
  })
}

/**
 * 取消关注
 * @param {Number} followUserId - 被关注用户ID
 * @returns {Promise}
 */
export function unfollowUser(followUserId) {
  return request({
    url: `/follows/user/${followUserId}`,
    method: 'delete'
  })
}

/**
 * 检查是否已关注
 * @param {Number} followUserId - 被关注用户ID
 * @returns {Promise}
 */
export function checkFollowed(followUserId) {
  return request({
    url: `/follows/user/${followUserId}/check`,
    method: 'get'
  })
}

/**
 * 获取关注列表
 * @param {Number} userId - 用户ID
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function getFollowingList(userId, params) {
  return request({
    url: `/follows/user/${userId}/following`,
    method: 'get',
    params
  })
}

/**
 * 获取粉丝列表
 * @param {Number} userId - 用户ID
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function getFollowerList(userId, params) {
  return request({
    url: `/follows/user/${userId}/followers`,
    method: 'get',
    params
  })
} 